# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=tcpextract
pkgver=1.1
pkgrel=9
groups=('blackarch' 'blackarch-networking')
pkgdesc='Extracts files from captured TCP sessions. Support live streams and pcap files.'
arch=('any')
url='https://pypi.org/project/tcpextract/#files'
license=('GPL3')
depends=('python2' 'python2-pynids')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$pkgname-$pkgver.tar.gz")
sha512sums=('d02e0dc579485379aea7d0375554eb1edea94709fe1a35c955801bf4d75ad6daafee2807994e9c11ae742233ac60710d9a8d339f9d9955a0f3583cac1badc1c4')

prepare() {
  cd "$pkgname-$pkgver"

  sed -i 's/env python/env python2/' *.py
}

package(){
  cd "$pkgname-$pkgver"

  python2 setup.py install --root="$pkgdir" --prefix=/usr -O1
}

